//
//  phoneCodeViewController.m
//  ioschishan
//
//  Created by 千翼网络科技 on 2017/7/28.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "phoneCodeViewController.h"
#import "MQVerCodeInputView.h"
#import "welcomeViewController.h"

@interface phoneCodeViewController ()

@end

@implementation phoneCodeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initView];
}

#pragma mark ----------------------- init ---------------------

- (void)initView{
    
    self.title = @"验证手机";
    
    MQVerCodeInputView *verView = [[MQVerCodeInputView alloc]initWithFrame:CGRectMake(screenScale(20), screenScale(50), scrWidth()- screenScale(40), screenScale(50))];
    verView.maxLenght = 6;//最大长度
    verView.keyBoardType = UIKeyboardTypeNumberPad;
    [verView mq_verCodeViewWithMaxLenght];
    verView.block = ^(NSString *text){
        NSLog(@"text = %@",text);
        
        if (text.length == 6) {
            
            [self.navigationController popToRootViewControllerAnimated:YES];
            
        }
    };
    //verView.center = self.view.center;
    [self.view addSubview:verView];
    
    UIButton *sendBtn = [ConfigXp buttonWithFrame:CGRectMake(screenScale(130), screenScale(170), screenScale(116), screenScale(30))
                                            title:@"重新发送"
                                       titleColor:getColor(@"9b9b9b")
                                             font:get4sFont(13)
                                  backgroundColor:nil
                                            image:nil];
    [sendBtn addTarget:self action:@selector(sendBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:sendBtn];
    
}

#pragma mark ----------------------- click ---------------------

- (void)sendBtnClick{

    NSLog(@"重新发送");
    
}

@end
